package com.itheima.day09;

import java.awt.*;
import java.util.*;

public class anli {
    public static void main(String[] args) {
        String[] xuanze ={"A","B","C","D"};
        Random r = new Random();
        Collection <String> c = new ArrayList<>();
        for (int i = 0; i < 80; i++) {
            int index = r.nextInt(xuanze.length);
            c.add(xuanze[index]);
        }
        System.out.println(c);
        Map<String,Integer> m = new HashMap<>();
        for (String s : c) {
            if(m.containsKey(s)){
                m.put(s,m.get(s)+1);
            }else{
                m.put(s,1);
            }
        }
        System.out.println(m);
    }
}
